/**
 * 气泡窗管理
 * @param {*} popupObj 
 * @returns 
 */

// 工具
import mittBus from "@/utils/mittBus"; // mitt - 组件传参工具

// 通用气泡窗
export const commonPopupInner = popupObj => {
    let popupDom = ''
    mittBus.emit('setCommonPopupInner', {
        popupObj, callback: (popupInnerDom) => {
            popupDom = popupInnerDom
        }
    })

    return popupDom
}

// 多个feature气泡窗
export const featuresPopupInner = (popupObj, next) => {
    let popupDom = ''
    let featureDataList = []
    // 设置重叠要素气泡窗html
    mittBus.emit('setFeaturesPopupInner', {
        popupObj, callback: (popupInnerDom) => {
            popupDom = popupInnerDom
        }, next: currentDataList => {
            featureDataList = currentDataList
        }
    })

    next(featureDataList)

    return popupDom
}

